package minijava;

import java.util.*;
import java.io.PrintStream;
import minijava.node.*;
import minijava.analysis.*;


public class MethodAnalysys extends DepthFirstAdapter
{

    public void inAMethodDecl(AMethodDecl node) {

        LinkedList<PVarDecl> copy = node.getArgs();
	if(copy.size()>0){
	    for(int i = 0; i<copy.size(); i++){
		for(int j = i+1; j<copy.size(); j++){
		    String firstParameter = copy.get(i).toString();
		    String secondParameter = copy.get(j).toString();
		    if(firstParameter.equals(secondParameter)){
			error("parameters with repeated names '" + firstParameter + "'");
		    }
		}
	    }
	}
    }
}
